﻿#define NGUI
using UnityEngine;
using System.Collections;


#if NGUI
/////////////////////////////////////////////////////////////////////
// UISprite 单挑多重颜色渐变.
/////////////////////////////////////////////////////////////////////
public class UISpriteColorsPercent : MonoBehaviour {
	UISprite sprite;
	public UIColorFader colorFader = new UIColorFader();
	
	// Use this for initialization
	void Start () {
		sprite = GetComponent<UISprite>();
	}
	
	// Update is called once per frame
	void Update () {
		if(sprite){
			Color c = colorFader.GetFadeColor(sprite.fillAmount);
			c.a = sprite.color.a;
			sprite.color = c;
		}
	}
}
#endif